package cn.gotom.core.pojos;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Set;

/**
 * 
 * 功能信息表
 * 
 * @author peixere@qq.com
 * 
 * @version 2012-12-03
 * 
 */
@Entity
@Table(name = "core_right")
public class Right extends BaseEntity implements Serializable
{
	private static final long serialVersionUID = 1L;

	@Column(nullable = false, length = 100)
	private String name;

	@Column(name = "group_name", nullable = false, length = 100)
	private String groupName;

	@Column(unique = true, nullable = false, length = 250)
	private String value;

	@Column(nullable = false)
	private int sort;

	@Column(name = "action_name", nullable = false, length = 100)
	private String actionName;

	@ManyToMany()
	@JoinTable(name = "core_role_right", joinColumns = { @JoinColumn(name = "right_id", nullable = false) }, inverseJoinColumns = { @JoinColumn(name = "role_id", nullable = false) })
	private Set<Role> roles;

	public Right()
	{
	}

	public String getName()
	{
		return this.name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getGroupName()
	{
		return groupName;
	}

	public void setGroupName(String groupName)
	{
		this.groupName = groupName;
	}

	public int getSort()
	{
		return this.sort;
	}

	public void setSort(int sort)
	{
		this.sort = sort;
	}

	public String getValue()
	{
		return this.value;
	}

	public void setValue(String value)
	{
		this.value = value;
	}

	public String getActionName()
	{
		return actionName;
	}

	public void setActionName(String actionName)
	{
		this.actionName = actionName;
	}

	public Set<Role> getRoles()
	{
		return this.roles;
	}

	public void setRoles(Set<Role> roles)
	{
		this.roles = roles;
	}

}